package com.hycat.mail.order.vo;

import com.hycat.mail.order.entity.OrderItemEntity;
import com.hycat.mail.order.to.OrderCreatTo;
import lombok.Data;

import java.util.List;

/**
 * @author : lzhycat
 * @date : 2022-08-25 10:23
 */
@Data
public class OrderLockStockVo {

    private String orderSn;

    List<OrderItemEntity> items;

    public static OrderLockStockVo from(OrderCreatTo to) {
        OrderLockStockVo orderLockStockVo = new OrderLockStockVo();
        orderLockStockVo.setOrderSn(to.getOrderEntity().getOrderSn());
        orderLockStockVo.setItems(to.getItems());
        return orderLockStockVo;
    }
}
